import { run } from 'jest';
import React from 'react';
import {  SafeAreaView, Text, View } from 'react-native';

//我是父组件
function App(){
  return(
    <SafeAreaView>
      <Text>======props=====</Text>
    <Text>我是text</Text>
    <Sub colos1='red'>
      <View style={{backgroundColor:'yellow'}}><Text>我是插槽传递过来的</Text></View>
    </Sub>
    </SafeAreaView>
  )
}


//我是子组件
//插槽 类似于 vue中 slot
function Sub(props:any){
  return(
    <View>
      <Text style={{color:props.colos1}}>我是子组件</Text>
      <View>{props.children}</View>
      </View>
  )
}
export default App;
